#include <REGX52.H>
#include <..\XC51.h>
#include <..\Behavior.h>
#include <..\Time.h>

int main(void)
{
	initTime();	
	
  while (1)
  {
    if (IrOK == 1)	
    {
			IrOK = 0;
      switch (Im[2])
      {
      case 0x0c:
        FindRoad();
        break;
      case 0x18:
        AvoidBox();
        break;
			case 0x5e:
				Control();
				break;
      default:
				stop();
        break;
      }
    }
  }
	
}
